class NucleoFamiliaresController < ApplicationController
  # GET /nucleo_familiares
  # GET /nucleo_familiares.xml
  def index
    @nucleo_familiares = NucleoFamiliar.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @nucleo_familiares }
    end
  end

  # GET /nucleo_familiares/1
  # GET /nucleo_familiares/1.xml
  def show
    @nucleo_familiar = NucleoFamiliar.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @nucleo_familiar }
    end
  end

  # GET /nucleo_familiares/new
  # GET /nucleo_familiares/new.xml
  def new
    @nucleo_familiar = NucleoFamiliar.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @nucleo_familiar }
    end
  end

  # GET /nucleo_familiares/1/edit
  def edit
    @nucleo_familiar = NucleoFamiliar.find(params[:id])
  end

  # POST /nucleo_familiares
  # POST /nucleo_familiares.xml
  def create
    @nucleo_familiar = NucleoFamiliar.new(params[:nucleo_familiar])

    respond_to do |format|
      if @nucleo_familiar.save
        flash[:notice] = 'NucleoFamiliar was successfully created.'
        format.html { redirect_to(@nucleo_familiar) }
        format.xml  { render :xml => @nucleo_familiar, :status => :created, :location => @nucleo_familiar }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @nucleo_familiar.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /nucleo_familiares/1
  # PUT /nucleo_familiares/1.xml
  def update
    @nucleo_familiar = NucleoFamiliar.find(params[:id])

    respond_to do |format|
      if @nucleo_familiar.update_attributes(params[:nucleo_familiar])
        flash[:notice] = 'NucleoFamiliar was successfully updated.'
        format.html { redirect_to(@nucleo_familiar) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @nucleo_familiar.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /nucleo_familiares/1
  # DELETE /nucleo_familiares/1.xml
  def destroy
    @nucleo_familiar = NucleoFamiliar.find(params[:id])
    @nucleo_familiar.destroy

    respond_to do |format|
      format.html { redirect_to(nucleo_familiares_url) }
      format.xml  { head :ok }
    end
  end
end
